<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const obj = {
      "281": {
        "name": "吴艳",
        "group": 1,
        "score": [
          53,
          87,
          100,
          100,
          null
        ]
      },
      "282": {
        "name": "江芳",
        "group": 2,
        "score": [
          83,
          50,
          70,
          null,
          null
        ]
      },
      "283": {
        "name": "杜强",
        "group": 3,
        "score": [
          87,
          38,
          57,
          null,
          null
        ]
      },
      "284": {
        "name": "林军",
        "group": 4,
        "score": [
          40,
          94,
          68,
          null,
          null
        ]
      },
      "285": {
        "name": "汪磊",
        "group": 5,
        "score": [
          80,
          77,
          88,
          null,
          null
        ]
      }
    }

    // console.log(obj['281'])
    // const obj1 = obj['281']
    // Object.keys() 获取对象的属性名 返回值是数组
    // Object.values() 获取对象的属性值 返回值是数组
    // const arr = Object.keys(obj)
    // // console.log(arr)

    // arr.map(item => {
    //   // console.log(item)
    //   console.log(obj[item].name)
    // })

    const arr = []

    for(let k in obj) {
      arr.push({
        id: k,
        ...obj[k]
      })
    }

    console.log(arr)

  </script>
</body>

</html>